Ext.define('BM.controller.ShortSutControllers', {
    extend: 'Ext.app.Controller',
	views: ['main.ShortSutButton','trade.AddCostItem','trade.ChangeToken','trade.AddDownPay',
			'trade.SelectTokenCheckOut','trade.ShortCut','trade.MargeBill','trade.SplitBill',
			'trade.CustomerBook'],
	//stores: ['TreeGoods'],
	//models: ['Token'],
    init: function() {
    
         this.control({
             'shortsutbutton>button':{
            	click:this.onShortSutClick
            },
            'shortsutbutton>splitbutton>menu':{
            	click:this.onShortSutMenuClick
            }
        });
    } ,
     //按快上面快捷主捷键时
    onShortSutClick:function(_btn,e){
    	
    	if(_btn.name == 'COST_ORDER'){
    		var _tokenOrder = Ext.widget('tokenorder');
    	    _tokenOrder.show();
    	}else if(_btn.name == 'COST_ADD'){
    	   
    		var _costItem = Ext.widget('addcostitem');
    		_costItem.show();
    	}else if(_btn.name == 'COST_CHECKOUT'){
    	   
    		var _selectCheckOut = Ext.widget('selecttokencheckout');
    		_selectCheckOut.show();
    	}else if(_btn.name == 'TOKEN_BOOK'){
    	   
    		var _customerBook = Ext.widget('customerbook');
    		_customerBook.show();
    	}
    },
     //按快上面快捷主键下拉菜单时
    onShortSutMenuClick:function(menu,item,e){
    
    	if(item.name== 'TOKEN_CHANGE'){
    	
    		var _changeToke = Ext.widget('changetoken');
    		_changeToke.show();
    	}else if(item.name== 'COST_ADDDOWNPAY'){
    	
    		var _addDownPay = Ext.widget('adddownpay');
    		_addDownPay.show();
    	}else if(item.name== 'COST_SHORTCUT'){
    	
    		var _shortCut = Ext.widget('shortcut');
    		_shortCut.show();
    	}else if(item.name== 'COST_MERGE'){
    	
    		var _margebill = Ext.widget('margebill');
    		_margebill.show();
    	}else if(item.name== 'COST_SPLIT'){
    	
    		var _splitbill = Ext.widget('splitbill');
    		_splitbill.show();
    	}else if(item.name== 'COST_BOOKLIST'){
    		
    		var _bookList = Ext.widget('customerbooklist');
    		_bookList.show();
    	}
    	
    }
});